package main

import "github.com/prometheus/client_golang/prometheus"

var (
	// MetricOnlineStatus 设备是否在线
	MetricOnlineStatus = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: metricNamePrefix + "_online_status",
			Help: "Online status (1=online, 0=offline)",
		},
		basicLableNames,
	)

	// MetricScrapeFailuresTotal 抓取失败计数器
	MetricScrapeFailuresTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: metricNamePrefix + "_scrape_failures_total",
			Help: "Total number of device scrape failures",
		},
		append(basicLableNames, "api"),
	)

	// MetricPingResponseTime PING响应时间
	MetricPingResponseTime = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    metricNamePrefix + "_ping_response_time",
			Help:    "Ping response time (seconds)",
			Buckets: []float64{0.1, 1.0, 2.0, 3.0},
		},
		basicLableNames,
	)

	// MetricAPIResponseTime API响应时间
	MetricAPIResponseTime = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    metricNamePrefix + "_api_response_time",
			Help:    "Time taken to scrape device metrics (seconds)",
			Buckets: []float64{0.1, 1.0, 2.0, 5.0, 10.0},
		},
		append(basicLableNames, "api"),
	)
)
